package cn.doourbest.learnspring.register;

import cn.doourbest.learnspring.mapping.ZscController;
import cn.doourbest.learnspring.service.LearnSpringService;
import cn.doourbest.learnspring.service.impl.LearnSpringServiceImpl;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @description:
 * @author: zhangsc
 * @create: 2019/12/6
 */
public class CustomerDefinitionRegister implements ImportBeanDefinitionRegistrar {


    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

        RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(LearnSpringServiceImpl.class);
        rootBeanDefinition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
        registry.registerBeanDefinition("learnSpringService",rootBeanDefinition);
    }
}
